package com.tsinghuabigdata.edu.ddmath.adapter;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;

import com.tsinghuabigdata.edu.ddmath.R;
import com.tsinghuabigdata.edu.ddmath.bean.MyCourse;
import com.tsinghuabigdata.edu.ddmath.bean.SubmitQuestion;
import com.tsinghuabigdata.edu.ddmath.bean.SumbitedItem;
import com.tsinghuabigdata.edu.ddmath.module.mylearn.MyLearnListActivity;
import com.tsinghuabigdata.edu.ddmath.view.MultiGridView;

import java.util.List;

/**
 * Created by Administrator on 2017/2/17.
 */

public class DoudouWorkAdatper extends CommonAdapter<SumbitedItem> {

    public DoudouWorkAdatper(Context context, List<SumbitedItem> mDatas) {
        super(context, mDatas);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.item_doudou_work;
    }

    @Override
    protected void convert(ViewHolder helper, int position, final SumbitedItem item) {
        helper.setText(R.id.tv_submit_month, item.getMonth());
        MultiGridView gridView = helper.getView(R.id.gv_submited);
        List<SubmitQuestion> questions = item.getQuestions();
        MonthSubmitedAdatper adatper = new MonthSubmitedAdatper(mContext, questions);
        gridView.setAdapter(adatper);
        gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            }
        });
    }
}
